cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

find_package(LibBin REQUIRED)
include_directories(${LibBin_INCLUDE_DIRS})

find_package(NetCDF REQUIRED COMPONENTS C CXX)
include_directories(${NetCDF_INCLUDE_DIRS})
set(LIBS ${NetCDF_LIBRARIES})

ADD_LIBRARY(bin++
  bin_io.cpp
  bin_util.cpp
  L3BinShape.cpp
  L3File.cpp
  L3BinShapeSMI.cpp
  L3FileSMI.cpp
)

ADD_LIBRARY(bin64++
  bin_io64.cpp
  bin_util64.cpp
  L3BinShape64.cpp
  L3File64.cpp
  L3BinShapeSMI64.cpp
  L3FileSMI64.cpp
)

target_link_libraries(bin++ ${LIBS} bin)
target_link_libraries(bin64++ ${LIBS} bin64)

install (TARGETS bin++ DESTINATION lib)
install (TARGETS bin64++ DESTINATION lib)
